package br.com.sovi.gwt.server.service.logoff;

import javax.servlet.http.Cookie;

import br.com.sovi.gwt.client.inicio.logoff.LogoffService;
import br.com.sovi.gwt.server.service.CurrentToken;
import br.com.sovi.gwt.server.service.CurrentUsuario;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

@SuppressWarnings("serial")
public class LogoffServiceImpl extends RemoteServiceServlet implements LogoffService {

	@Override
	public void efetuarLogoff() {
		CurrentToken.setCurrent(null);
		getThreadLocalResponse().addCookie(new Cookie(CurrentToken.TOKEN, ""));
		CurrentUsuario.setCurrent(null);
	}

}
